class BubbleSort {
public:
    int* bubbleSort(int* A, int n) {
        // write code here
        for(int i = 1; i < n ; i++){
            if(A[i - 1] > A[i]){
                int j = i;
            	while(A[j - 1] > A[j]){
                	int temp = A[j-1];
                	A[j - 1] = A[j];
                	A[j] = temp;
                    j--;
            	}
            }
        }
        return A;
    }
};
